<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<body>

<h3>Welcome to NIIT</h3>
<ul>
    <li>Java 8</li>
    <li>Spring</li>
    <li>MyBatis</li>
    <li>BigData</li>
</ul>
<c:url value="/logout" var="logoutUrl"/>
<form id="logout" action="${logoutUrl}" method="post">
    <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}"
    />
</form>
<c:if test="${pageContext.request.userPrincipal.name != null}">
    <a href="javascript:document.getElementById('logout').submit()">Logout</a>
</c:if>
<c:if test="${pageContext.request.userPrincipal.name != null}">
    <a href="/index.html">index.html</a>
</c:if>
<c:if test="${pageContext.request.userPrincipal.name != null}">
    <a href="/r/r1">r1资源</a>
</c:if>
<c:if test="${pageContext.request.userPrincipal.name != null}">
    <a href="/r/r2">r2资源</a>
</c:if>
</body>
</html>
